package b4.config
{
	public class TownConfig
	{
		public var index:int;
		public var name:String;
		public var bgrImg:String;
		public var layers:Array;
		public var swfName:String;
		public var xmlName:String;
		
		public function TownConfig(itemStrs:Array = null)
		{
			if (itemStrs != null)
			{			
				index = parseInt(itemStrs[0]);
				name = itemStrs[1];
				swfName = itemStrs[2];
				xmlName = itemStrs[3];
			}
		}
		
		public function loadDataXML(dataXML:XML):void
		{
			if (dataXML != null)
			{
				this.index = parseInt(dataXML.index);
				this.name = dataXML.name;
				this.bgrImg = dataXML.bgrImg;
				layers = new Array();
				//解析每层信息
				for (var i:int = 0; i < dataXML.layerInfo.layer.length(); i++)
				{
					var layerStr:String = dataXML.layerInfo.layer[i];
					layers.push(new LayerConfig(layerStr));
				}
			}
		}

	}
}